#include<string>
#include<ctime>
//#include<memory>
#include"HttpServer.hpp"
#include"Util.hpp"
using std::string;

//主入口
// GET | POST

void Usess(string s)
{
    cout << "use:    " << s << " port" << endl;
}

int main(int argc,char* argv[])
{	
    //timeprin();
    if(argc != 2)
    {
        Usess(argv[0]);
        exit(1);
    }
    int port = atoi(argv[1]);
    //std::shared_ptr<HttpServer> http_server(new HttpServer(port));
    //http_server->Init();
    //http_server->Loop();
    
    HttpServer http_server(port);
    
    Util::map_init();
    Util::InitSuffix();

    http_server.Init();
    
    http_server.Loop();
    
    //Tcpserver* tcpser = Tcpserver::getTcpserver(8081);
    //cout << "--------------------------------------" << endl;
    while(true)
    {

    }
    return 0;
}
